package com.nit.generate;

import com.nit.tools.loop.NitLoopTools;

/**
 * 端口号 生成器
 *
 * @Auth: 逆天开源-逍遥哥哥
 * @link: 1715656022@qq.com
 * @Date: 2023-07-26
 */
public class NitPortGenerator {
    public static void main(String[] args) {
        NitLoopTools.loop(4, () -> {
            int tmp = NitPortGenerator.generate();
            System.out.println("随机端口:" + tmp + "<br>");
        });
    }

    /**
     * 随机端口号-1024及以上的端口号
     *
     * @return 随机端口号
     */
    public static int generate() {
        return NitNumberGenerator.generateInt(1025, 65535);
    }
}
